/* Add trim function for String object */
String.prototype.trim=function()
{
     return this.replace(/(^\s*)|(\s*$)/g, '');
}

/* Add ltrim function for String object */
String.prototype.ltrim=function()
{
     return this.replace(/(^\s*)/g,'');
}

/* Add rtrim function for String object */
String.prototype.rtrim=function()
{
     return this.replace(/(\s*$)/g,'');
}

global.atob = function(base64String) {
    var buffer = new Buffer(base64String, 'base64');

    return buffer.toString();
}

global.btoa = function(string) {
    var buffer = new Buffer(string);

    return buffer.toString('base64');
}